export function replaceUrl(url) {
	// replaceAllS(url,'-','/')
	// console.log(url);
	// let a = replaceAllS(url,'-','/')
	// console.log(a);
	let u = replaceAllS(url,'-','/')
	let top = u.substring(0, u.lastIndexOf('/'))
	let bottom = u.substring(u.lastIndexOf('/')).replace('/', '.')
	return top + bottom
}

export function replaceAllS(str,r,n){
	return str.indexOf(r) == -1 ? str : replaceAllS(str.replace(r,n),r,n)
}

/**
 * 跳转文章详情
 * @param {Object} id 文章ID
 */
export function toDetail(id) {
	uni.navigateTo({
		url: `/pages/pageDetail/pageDetail?id=${id}`
	})
}
